use actix_web::web;

use crate::{
    database::{table, DbPool},
    route::form::category::{CategoryForm, NewCategoryForm},
    service::ServiceError,
    srv_add, srv_del, srv_get_by_slug, srv_get_in_page, srv_upd,
};

srv_add!(add, NewCategoryForm, table::category::crud::create);
srv_upd!(upd, CategoryForm, table::category::crud::update);
srv_del!(del, table::category::crud::delete);

srv_get_in_page!(
    get_in_page,
    CategoryForm,
    table::category::crud::read_count_from_offset
);
srv_get_by_slug!(
    get_by_slug,
    CategoryForm,
    table::category::crud::read_by_slug
);
